#include<stdio.h>
#include<string.h>

int main()
{
    int n=123456;
    char s[100];
    sprintf(s,"%d%d",n%10,n/10);
    puts(s);
    int m;
    sscanf(s,"%d",&m);
    printf("%d\n",m);
    return 0;
}
